//package com.openecommerce.service.impl;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import javax.annotation.Resource;
//
//import com.openecommerce.domain.ProductInventoryStock;
//import com.openecommerce.domain.ProductInventoryStockItem;
//import com.openecommerce.domain.ProductInventoryStockUpdateEntity;
//import com.openecommerce.persistence.ProductInventoryStockMapper;
//import com.openecommerce.service.ProductInventoryStockService;
//
//public class ProductInventoryStockServiceImpl implements
//		ProductInventoryStockService {
//	
//	@Resource
//	private ProductInventoryStockMapper productInventoryStockMapper;
//	
//	@Override
//	public List<ProductInventoryStockItem> getList(Long[] products) {
//		List<ProductInventoryStockItem> list = new ArrayList<ProductInventoryStockItem>();
//		for(int index = 0;index < products.length ; index++){
//			ProductInventoryStock item = productInventoryStockMapper.selectByProductId(products[index]);
//			if(item != null){
//				ProductInventoryStockItem sockItem = new ProductInventoryStockItem();
//				sockItem.setIsInStock(item.getIsInStock());
//				sockItem.setProductId(item.getProductId());
//				sockItem.setQty(item.getQty());
//				sockItem.setSku(item.getSku());
//				list.add(sockItem);
//			}
//		}
//		return list;
//	}
//
//	@Override
//	public boolean updateUseConfig(Long productId,
//			ProductInventoryStockUpdateEntity data) {
//		ProductInventoryStock productInventoryStock = new ProductInventoryStock();
//		data.fillChildObject(productInventoryStock);
//		productInventoryStock.setProductId(productId);
//		int result = productInventoryStockMapper.updateByProductIdSelective(productInventoryStock);
//		return result == 1? true:false;
//	}
//
//	@Override
//	public boolean update(ProductInventoryStockItem data) {
//		ProductInventoryStock productInventoryStock = new ProductInventoryStock();
//		productInventoryStock.setProductId(data.getProductId());
//		productInventoryStock.setIsInStock(data.getIsInStock());
//		productInventoryStock.setQty(data.getQty());
//		productInventoryStock.setSku(data.getSku());
//		int result = productInventoryStockMapper.updateByProductIdSelective(productInventoryStock);
//		return result == 1? true:false;
//	}
//
//}
